package com.wlyy.bcwlw.sys.audit.web;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.directwebremoting.annotations.RemoteProxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.wlyy.bcwlw.base.BaseController;
import com.wlyy.bcwlw.sys.audit.dao.UnprotectUrlDAO;
import com.wlyy.bcwlw.sys.audit.entity.UnprotectUrlDTO;
import com.wlyy.bcwlw.sys.audit.service.UnprotectUrlService;

@RemoteProxy
@Controller
@RequestMapping("/sys/unProtectUrl")
public class SysUnprotectUrlController extends BaseController {

	@Autowired
	private UnprotectUrlDAO unprotectUrlDAO;
	@Autowired
	private UnprotectUrlService unprotectUrlService;
	
	@RequestMapping("/view")
	public String view(HttpServletRequest request,HttpServletResponse response){
		return "sys/unProtectUrl/url-view";
	}
	
	
	@RequestMapping("/list")
	public String appList(HttpServletRequest request, HttpServletResponse response) throws Exception{
		int curPage = getPageNum(request);
		int limit = getInternal(request);
		
		List<UnprotectUrlDTO> list = unprotectUrlDAO.queryByObject(null);
		
		int count = list.size();
		
		processJsonData4Grid(request, response, limit, curPage, count, list);
		
		return null;
	}
	
	public boolean saveUnProtectUrlInfo(UnprotectUrlDTO unprotectUrlDTO){
		return unprotectUrlService.saveUnProtectUrlInfo(unprotectUrlDTO);
	}
	
	public boolean removeUnProtectUrlById(Integer id){
		return unprotectUrlService.removeUnProtectUrlById(id);
	}

}
